﻿#region Software License
/**************************************************************/
/*          Business of Software Consulting                   */
/*          FREE SOFTWARE LICENSE                             */
/**************************************************************/
/*  Directory Manifest Generator                              */
/*  by: Mike Cating                                           */
/*  © 2009 Business of Software Consulting                    */
/*                                                            */
/* BUSINESS OF SOFTWARE CONSULTING DISCLAIMS ALL WARRANTIES,  */
/* RESPONSIBILITIES, AND LIABILITIES ASSOCIATED WITH          */
/* USE OF THIS CODE IN ANY WAY, SHAPE, OR FORM                */
/* REGARDLESS HOW IMPLICIT, EXPLICIT, OR OBSCURE IT           */
/* IS. IF THERE IS ANYTHING QUESTIONABLE WITH REGARDS         */
/* TO THIS SOFTWARE BREAKING AND YOU GAIN A LOSS OF           */
/* ANY NATURE, WE ARE NOT THE RESPONSIBLE PARTY. USE          */
/* OF THIS SOFTWARE CREATES ACCEPTANCE OF THESE TERMS         */
/*                                                            */
/* USE OF THIS CODE MUST RETAIN ALL COPYRIGHT NOTICES         */
/* AND LICENSES (MEANING THIS TEXT).                          */
/*                                                            */
/**************************************************************/
#endregion


using System;
using System.Collections.Generic;
using System.Text;
using System.Globalization;
using System.Xml;
using System.Xml.Serialization;

namespace BOSTools.DirectoryManifestGenerator
{
    public class VersionInfo
    {
        private Int32 _majorVer;
        private Int32 _minorVer;
        private Int32 _buildNumber;
        private Int32 _revisionNumber;

        public VersionInfo()
        {

        }

        public VersionInfo(Int32 major, Int32 minor, Int32 buildNumber, Int32 revisionNumber)
        {
            _majorVer = major;
            _minorVer = minor;
            _buildNumber = buildNumber;
            _revisionNumber = revisionNumber;
        }

        [XmlAttribute()]
        public Int32 MajorVersion
        {
            get { return _majorVer; }
            set { _majorVer = value; }
        }

        [XmlAttribute()]
        public Int32 MinorVersion
        {
            get { return _minorVer; }
            set { _minorVer = value; }
        }

        [XmlAttribute()]
        public Int32 BuildNumber
        {
            get { return _buildNumber; }
            set { _buildNumber = value; }
        }

        [XmlAttribute()]
        public Int32 RevisionNumber
        {
            get { return _revisionNumber; }
            set { _revisionNumber = value; }
        }

        public override string ToString()
        {
            return string.Format(CultureInfo.InvariantCulture, "{0}.{1}.{2}.{3}", _majorVer,
                _minorVer, _buildNumber, _revisionNumber);
        }
    }
}
